Skip to content

feat(IN-09): decision execution wiring — ClusterManager executes Merge/Split#111

Open
rebelmachina wants to merge 5 commits intomainfrom
feat/decision-execution-wiring
Open

feat(IN-09): decision execution wiring — ClusterManager executes Merge/Split#111
rebelmachina wants to merge 5 commits intomainfrom
feat/decision-execution-wiring

Conversation

@rebelmachina
Copy link
Copy Markdown
Contributor

Reopened from #86 (auto-closed when base branch feat/affinity-engine was deleted on merge of #77). Rebased cleanly onto main — 5 commits, no conflicts.

Closes #78 (epic).

Summary

Notable fixes found during implementation

  • Bootstrap now keys servers by cluster_id (not random server_id) so execute_merge/split can look up the correct handle
  • Zero-cooldown edge case: inserting a 0-tick entry would block same-cycle decisions via contains_key — guarded

Test plan

cargo test -p arcane-infra -p arcane-spatial

18 tests pass (11 existing + 7 new).

rebelmachina and others added 5 commits May 3, 2026 00:37
Replace `allocated_servers: Vec<ServerHandle>` with `servers: HashMap<Uuid,
ServerHandle>` (cluster_id key) so execute_merge/split can look up and
release servers by cluster_id.

Add `SpatialIndex::reassign_cluster(from, to)` — O(n) bulk entity
reassignment called during merge execution.

Closes #79, closes #80.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ExecutionConfig struct (min_confidence, merge/split cooldown ticks,
max_per_cycle) with sensible defaults. Add merge_cooldowns and
split_cooldowns hashmaps to ClusterManager. Tick down and prune
cooldowns at the start of each evaluation cycle.

Closes #81.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add execute_merge(): confidence/cooldown guardrails, SpatialIndex
reassign_cluster, pool.release, servers map cleanup, merge cooldown
recording.

Add execute_split(): confidence/cooldown guardrails, pool.allocate,
group_b entity migration via update_entity, split cooldown on both
resulting cluster ids. Pool exhaustion is a non-fatal skip.

Add tracing dep to arcane-infra for warn! calls.

Closes #82, closes #83.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace discarded `let _decisions` with a decision execution loop:
bootstrap server allocation now happens before model evaluation; model
decisions are applied in priority order up to max_per_cycle per tick;
execution errors are logged as warnings and do not abort the cycle.

Closes #84.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 7 integration tests: merge execution, split execution, confidence
guardrail, merge cooldown, pool exhaustion skip, max_per_cycle cap,
cooldown expiry.

Fix bootstrap: allocate servers keyed by cluster_id (not server_id) so
execute_merge/split can look up the correct handle.

Fix cooldown edge case: skip inserting cooldown entry when ticks=0 to
avoid blocking same-cycle decisions (would break max_per_cycle=∞ case).

Export ExecutionConfig from arcane-infra lib.rs.

Closes #85.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Epic: Decision Execution Wiring — ClusterManager executes Merge/Split decisions (IN-09)

1 participant